#pragma once

/*---------------------------------------------------------------------------*/
/*                                Image Data                                 */
/*---------------------------------------------------------------------------*/

#define IMG_ERASER_W 7
#define IMG_ERASER_H 7

PROGMEM static const uint8_t imgEraser[][7] = { // 7x7 x7
    { 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
    { 0x00, 0x00, 0x08, 0x1C, 0x08, 0x00, 0x00 },
    { 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00 },
    { 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x1C, 0x08 },
    { 0x1C, 0x3E, 0x7F, 0x1F, 0x7F, 0x3E, 0x1C },
    { 0x3E, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x3E },
    { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F }
};

#define IMG_CURSOR_W 7
#define IMG_CURSOR_H 7
#define IMG_CURSOR_ID_CLEAR 6

PROGMEM static const uint8_t imgCursor[][7] = { // 7x7 x7
    { 0x63, 0x41, 0x00, 0x00, 0x00, 0x41, 0x63 },
    { 0x71, 0x01, 0x01, 0x00, 0x40, 0x40, 0x47 },
    { 0x38, 0x01, 0x01, 0x41, 0x40, 0x40, 0x0E },
    { 0x1C, 0x00, 0x41, 0x41, 0x41, 0x00, 0x1C },
    { 0x0E, 0x40, 0x40, 0x41, 0x01, 0x01, 0x38 },
    { 0x47, 0x40, 0x40, 0x00, 0x01, 0x01, 0x71 },
    { 0x7F, 0x41, 0x41, 0x41, 0x41, 0x41, 0x7F }
};

#define IMG_OVER_W 110
#define IMG_OVER_H 8

PROGMEM static const uint8_t imgOver[110] = { // 110x8
    0x81, 0xFF, 0x87, 0x0E, 0x1C, 0x78, 0xE1, 0xFF, 0x01, 0x3C, 0x7E, 0xC3, 0x81, 0x81, 0xC3, 0x7E,
    0x3C, 0x00, 0x00, 0x00, 0x81, 0xFF, 0x87, 0x3E, 0xF0, 0x30, 0x8E, 0xFF, 0xFF, 0x81, 0x00, 0x3C,
    0x7E, 0xC3, 0x81, 0x81, 0xC3, 0x7E, 0x3C, 0x00, 0x81, 0xFF, 0xFF, 0x91, 0x31, 0xEF, 0xC6, 0x80,
    0x00, 0x81, 0xFF, 0xFF, 0x91, 0xB9, 0x81, 0xC3, 0x00, 0x00, 0x00, 0x81, 0xFF, 0x87, 0x3E, 0xF0,
    0x30, 0x8E, 0xFF, 0xFF, 0x81, 0x00, 0x3C, 0x7E, 0xC3, 0x81, 0x81, 0xC3, 0x7E, 0x3C, 0x00, 0x01,
    0x07, 0x1F, 0xF9, 0xC0, 0x39, 0x07, 0x01, 0x81, 0xFF, 0xFF, 0x91, 0xB9, 0x81, 0xC3, 0x00, 0x66,
    0x8F, 0x99, 0x99, 0xF3, 0x60, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0
};

#define IMG_PERFECT_W 64
#define IMG_PERFECT_H 8

PROGMEM static const uint8_t imgPerfect[64] = { // 64x8
    0x81, 0xFF, 0xFF, 0x91, 0x11, 0x1F, 0x0E, 0x00, 0x81, 0xFF, 0xFF, 0x91, 0xB9, 0x81, 0xC3, 0x00,
    0x81, 0xFF, 0xFF, 0x91, 0x31, 0xEF, 0xC6, 0x80, 0x00, 0x81, 0xFF, 0xFF, 0x91, 0x11, 0x39, 0x03,
    0x00, 0x81, 0xFF, 0xFF, 0x91, 0xB9, 0x81, 0xC3, 0x00, 0x3C, 0x7E, 0xC3, 0x81, 0x81, 0x81, 0x66,
    0x00, 0x03, 0x01, 0x81, 0xFF, 0xFF, 0x81, 0x01, 0x03, 0x00, 0x00, 0xDF, 0xC7, 0x00, 0xDF, 0xC7
};

#define IMG_DIGIT_W 12
#define IMG_DIGIT_H 16

PROGMEM static const uint8_t imgDigit[][24] = { // 12x16 x10
    {
        0xF0, 0xFC, 0xFE, 0x06, 0x01, 0x01, 0x01, 0x06, 0xFE, 0xFC, 0xF0, 0x00, 0x0F, 0x3F, 0x7F, 0xE0,
        0x80, 0x80, 0x80, 0x60, 0x7F, 0x3F, 0x0F, 0x00
    },{
        0x00, 0x00, 0x02, 0x02, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
        0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x00, 0x00
    },{
        0x08, 0x1C, 0x0E, 0x03, 0x01, 0x01, 0x83, 0xFF, 0xFE, 0x3C, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xEC,
        0xE6, 0xE3, 0xE3, 0xE1, 0xE0, 0xE0, 0x00, 0x00
    },{
        0x00, 0x0C, 0x0E, 0x87, 0x81, 0x81, 0xC3, 0x7F, 0x7E, 0x1C, 0x00, 0x00, 0x00, 0x38, 0x78, 0xE0,
        0x80, 0x80, 0x81, 0xC1, 0x7F, 0x7F, 0x1C, 0x00
    },{
        0x00, 0x00, 0xC0, 0x20, 0x18, 0x04, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0C, 0x0F, 0x0C, 0x0C,
        0x0C, 0x0C, 0xFF, 0xFF, 0xFF, 0x0C, 0x0C, 0x00
    },{
        0x00, 0x00, 0xFE, 0x87, 0x87, 0x87, 0x87, 0x87, 0x07, 0x07, 0x00, 0x00, 0x00, 0x30, 0x70, 0xE0,
        0x80, 0x80, 0x80, 0xC1, 0x7F, 0x7F, 0x1E, 0x00
    },{
        0x00, 0xE0, 0xF0, 0x78, 0x9C, 0x86, 0x86, 0x82, 0x81, 0x01, 0x00, 0x00, 0x0F, 0x3F, 0x7F, 0xE1,
        0x80, 0x80, 0x80, 0xC1, 0x7F, 0x7F, 0x1E, 0x00
    },{
        0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x87, 0xE7, 0x3F, 0x07, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xF0,
        0xFC, 0x3F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00
    },{
        0x38, 0x7E, 0xFE, 0xE3, 0xC1, 0x81, 0xC3, 0xFE, 0x3E, 0x1C, 0x00, 0x00, 0x38, 0x7C, 0x7E, 0xC3,
        0x81, 0x83, 0x83, 0xC7, 0x7F, 0x7F, 0x1C, 0x00
    },{
        0xF8, 0xFC, 0xFE, 0x83, 0x01, 0x01, 0x01, 0x07, 0xFE, 0xFC, 0xF0, 0x00, 0x00, 0x81, 0x83, 0x43,
        0x42, 0x62, 0x32, 0x1D, 0x1F, 0x07, 0x01, 0x00
    }
};


/*---------------------------------------------------------------------------*/
/*                                Sound Data                                 */
/*---------------------------------------------------------------------------*/

enum {
    SND_PRIO_START = 0,
    SND_PRIO_OVER,
    SND_PRIO_EFFECTS,
};

PROGMEM static const byte soundStart[] = {
    0x90, 0x48, 0x00, 0x64, 0x90, 0x4A, 0x00, 0x64, 0x90, 0x4C, 0x00, 0x64, 0x90, 0x4D, 0x00, 0x64,
    0x90, 0x4F, 0x00, 0xC8, 0x80, 0xF0
};

PROGMEM static const byte soundOver[] = {
    0x90, 0x37, 0x00, 0x78, 0x90, 0x36, 0x00, 0x8C, 0x90, 0x35, 0x00, 0xA0, 0x90, 0x34, 0x00, 0xB4,
    0x90, 0x33, 0x00, 0xC8, 0x90, 0x32, 0x00, 0xDC, 0x90, 0x31, 0x00, 0xF0, 0x90, 0x30, 0x00, 0xFF,
    0x80, 0xF0
};

PROGMEM static const byte soundPerfect[] = {
    0x90, 0x51, 0x00, 0x28, 0x80, 0x00, 0x28, 0x90, 0x56, 0x00, 0x28, 0x80, 0x00, 0x28, 0x90, 0x5A,
    0x00, 0x28, 0x80, 0x00, 0x28, 0xE0
};

PROGMEM static const byte soundErase0[] = {
    0x90, 0x6C, 0x00, 0x24, 0x90, 0x60, 0x00, 0x28, 0x80, 0xF0
};

PROGMEM static const byte soundErase1[] = {
    0x90, 0x6E, 0x00, 0x20, 0x90, 0x62, 0x00, 0x24, 0x90, 0x4A, 0x00, 0x28, 0x80, 0xF0
};

PROGMEM static const byte soundErase2[] = {
    0x90, 0x70, 0x00, 0x1C, 0x90, 0x64, 0x00, 0x20, 0x90, 0x58, 0x00, 0x24, 0x90, 0x4C, 0x00, 0x28,
    0x80, 0xF0
};

PROGMEM static const byte soundErase3[] = {
    0x90, 0x72, 0x00, 0x18, 0x90, 0x66, 0x00, 0x1C, 0x90, 0x5A, 0x00, 0x20, 0x90, 0x4E, 0x00, 0x24,
    0x90, 0x42, 0x00, 0x28, 0x80, 0xF0
};

PROGMEM static const byte soundErase4[] = {
    0x90, 0x74, 0x00, 0x14, 0x90, 0x68, 0x00, 0x18, 0x90, 0x5C, 0x00, 0x1C, 0x90, 0x50, 0x00, 0x20,
    0x90, 0x44, 0x00, 0x24, 0x90, 0x38, 0x00, 0x28, 0x80, 0xF0
};

PROGMEM static const byte * const soundEraseTable[] = {
    soundErase0, soundErase1, soundErase2, soundErase3, soundErase4
};

PROGMEM static const byte soundFall[] = {
    0x90, 0x37, 0x00, 0x0C, 0x90, 0x34, 0x00, 0x0C, 0x90, 0x30, 0x00, 0x0C, 0x90, 0x38, 0x00, 0x08,
    0x90, 0x35, 0x00, 0x08, 0x90, 0x31, 0x00, 0x08, 0x80, 0xF0
};

PROGMEM static const byte soundUndo[] = {
    0x90, 0x44, 0x00, 0x3C, 0x90, 0x47, 0x00, 0x3C, 0x90, 0x49, 0x00, 0x3C, 0x80, 0xF0
};
